package online.heycm.platform.web.boot;

import online.heycm.platform.web.common.exception.WebExceptionHandler;
import online.heycm.platform.web.common.filter.MethodFilter;
import online.heycm.platform.web.common.filter.TraceFilter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * WebBootAutoConfiguration
 *
 * @author heycm
 * @since 2023/12/9 17:51
 */
@Configuration
public class WebBootAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public MethodFilter methodFilter() {
        return new MethodFilter(0);
    }

    @Bean
    @ConditionalOnMissingBean
    public TraceFilter traceFilter() {
        return new TraceFilter(1);
    }

}
